package com.design_patterns.builder;

/**
 * @author: 李德才
 * @description:
 * @create: 2020-09-19 15:08
 **/
public class Person {
    private Integer id;
    private String name;
    private Integer age;
    private Integer sex;
    private Address address;

    public Person(PersonBuilder builder){
        this.id =  builder.getId();
        this.name = builder.getName();
        this.age = builder.getAge();
        this.sex = builder.getSex();
        this.address = builder.getAddress();
    }

    @Override
    public String toString() {
        return "Person{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                ", address=" + address +
                '}';
    }
}
